package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.ReportConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by sxy on 2016/7/12.
 */
public interface ReportConfigRepository extends JpaRepository<ReportConfig, Integer>, JpaSpecificationExecutor<ReportConfig> {

    @Query("select u from ReportConfig u where u.reportCode=?1  and u.isDeleted<>1 order by  u.parentCode" )
    List<ReportConfig> getReportConfigListByName(String name);

    @Query("select u.formularExpression from ReportConfig u where u.formularExpression is not null and u.formularExpression <>'' and u.isDeleted<>1 order by  u.parentCode" )
    List<ReportConfig> getAllFormularExpression();
}
